home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / System Extras Headers / AOCE Headers / OCETemplates.h < prev   
Encoding:
C/C++ Source or Header  |  1994-07-13  |  77.0 KB  |  2,268 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        OCETemplates.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __OCETEMPLATES__
  13. #define __OCETEMPLATES__
  14.  
  15. #ifndef REZ
  16. #ifndef __TYPES__
  17. #include <Types.h>
  18. /*    #include <ConditionalMacros.h>                                */
  19. /*    #include <MixedMode.h>                                        */
  20. /*        #include <Traps.h>                                        */
  21. #endif
  22.  
  23. #ifndef __EVENTS__
  24. #include <Events.h>
  25. /*    #include <Quickdraw.h>                                        */
  26. /*        #include <QuickdrawText.h>                                */
  27. /*            #include <IntlResources.h>                            */
  28. /*    #include <OSUtils.h>                                        */
  29. #endif
  30.  
  31. #endif
  32.  
  33. #ifndef __OCE__
  34. #include "OCE.h"
  35. /*    #include <Aliases.h>                                        */
  36. /*        #include <AppleTalk.h>                                    */
  37. /*        #include <Files.h>                                        */
  38. /*            #include <SegLoad.h>                                */
  39. /*    #include <AppleEvents.h>                                    */
  40. /*        #include <Memory.h>                                        */
  41. /*        #include <EPPC.h>                                        */
  42. /*            #include <PPCToolBox.h>                                */
  43. /*            #include <Processes.h>                                */
  44. /*        #include <Notification.h>                                */
  45. /*    #include <Script.h>                                            */
  46. #endif
  47.  
  48. #ifndef REZ
  49. #ifndef __OCESTANDARDMAIL__
  50. #include "OCEStandardMail.h"
  51. /*    #include "OCEAuthDir.h"                                        */
  52. /*    #include "OCEMail.h"                                        */
  53. /*        #include "DigitalSignature.h"                            */
  54. /*        #include "OCEMessaging.h"                                */
  55. /*        #include <TextEdit.h>                                    */
  56. /*    #include <Windows.h>                                        */
  57. /*        #include <Controls.h>                                    */
  58. /*            #include <Menus.h>                                    */
  59. /*    #include <Dialogs.h>                                        */
  60. #endif
  61.  
  62. #endif
  63.  
  64. /************************************************************************************************/
  65. /********************************* Template Resource Constants: *********************************/
  66. /************************************************************************************************/
  67.  
  68.  
  69. /* Current versions of all the different template types: */
  70.  
  71. #define kDETAspectVersion -976
  72. #define kDETInfoPageVersion -976
  73. #define kDETKillerVersion -976
  74. #define kDETForwarderVersion -976
  75. #define kDETFileTypeVersion -976
  76.  
  77.  
  78. /*    "Normal" separation for template IDs within the file (this is just a suggestion; you can use whatever
  79.     separation you like, so long as two separate templates don't have overlapping resources): */
  80. #define kDETIDSep 250
  81.  
  82. /* A few predefined base IDs (again, just suggestions): */
  83. #define kDETFirstID (1000)
  84. #define kDETSecondID (1000+kDETIDSep)
  85. #define kDETThirdID (1000+2*kDETIDSep)
  86. #define kDETFourthID (1000+3*kDETIDSep)
  87. #define kDETFifthID (1000+4*kDETIDSep)
  88.  
  89. /*    Templates consist of a set of associated resources, at constant offsets from a "base ID" set by the
  90.     signature resource of the template. In the case of aspect templates, most of the resources in the
  91.     template are accessible from the template as property default values. The property number is the same
  92.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  93.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. */
  94.     
  95. /*    All templates include the following resource fork resources:
  96.  
  97.      Type    Offset                        Description
  98.      ----    ------                        -----------
  99.     'rstr'    kDETTemplateName            Contains the name of the template
  100.  
  101. */
  102.  
  103. #define kDETTemplateName 0
  104.  
  105. /*    Aspects, info-pages, and forwarders include the following as well:
  106.  
  107.      Type    Offset                        Description
  108.      ----    ------                        -----------
  109.     'rstr'    kDETRecordType                Contains the type of record this applies to
  110.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  111.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  112.  
  113. */
  114.  
  115. #define kDETRecordType 1
  116. #define kDETAttributeType 2
  117. #define kDETAttributeValueTag 3
  118.  
  119. /* ************************************ Aspects */
  120.  
  121. /*    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  122.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  123.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  124.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  125.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  126.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  127.     'detb' corresponds to kDETPrTypeBinary.
  128.  
  129.      Type    Offset                        Description
  130.      ----    ------                        -----------
  131.     'deta'    0                            Identifies the type of resource
  132.     'detc'    kDETCode                    Is the code resource, if any is used
  133.     'ICN#'    kDETAspectMainBitmap
  134.     'icl8'    kDETAspectMainBitmap
  135.     'icl4'    kDETAspectMainBitmap
  136.     'ics#'    kDETAspectMainBitmap
  137.     'ics8'    kDETAspectMainBitmap
  138.     'ics4'    kDETAspectMainBitmap
  139.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  140.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  141.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  142.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  143.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  144.                                         another template; if no other template provides an external name for a given internal
  145.                                         category, the internal name is used as the external name (main aspect only)
  146.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  147.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  148.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  149.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  150.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  151.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  152.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  153.                                         property # times 2 is used as an index into this array; if the item is not editable,
  154.                                         then the property # times 2 plus 1 is used
  155.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  156.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  157.                                         is used in a selection dialog invoked by an "Add..." button
  158.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  159.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  160.                                         is the tag; the rest is the attribute value contents
  161.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  162.                                         from a code resource, or via a default value in a resource)
  163.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  164.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  165.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like "add" or "drop"; if
  166.                                         there's any doubt, use "OK")
  167.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  168.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  169.                                         can be dragged into this aspect, and the second is the attribute type to store
  170.                                         the reference in
  171.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  172.                                         category of records which can be dragged in, and the second is the type of
  173.                                         attribute to place the alias in
  174.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  175.                                         dragged from (or "" for any), the second is the attribute type which can be dragged
  176.                                         in, and the third is the attribute type to store the new attribute in
  177.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  178.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  179.                                         everything can be dragged out)
  180.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  181.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  182.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  183.                                             page-selector (main aspect only)
  184.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  185. */
  186.  
  187. #define kDETAspectCode 4
  188. #define kDETAspectMainBitmap 5
  189. #define kDETAspectName 6
  190. #define kDETAspectCategory 7
  191. #define kDETAspectExternalCategory 8
  192. #define kDETAspectKind 9
  193. #define kDETAspectGender 10
  194. #define kDETAspectWhatIs 11
  195. #define kDETAspectAliasKind 12
  196. #define kDETAspectAliasGender 13
  197. #define kDETAspectAliasWhatIs 14
  198. #define kDETAspectBalloons 15
  199. #define kDETAspectNewMenuName 16
  200. #define kDETAspectNewEntryName 17
  201. #define kDETAspectNewValue 18
  202. #define kDETAspectSublistOpenOnNew 19
  203. #define kDETAspectLookup 20
  204. #define kDETAspectDragInString 21
  205. #define kDETAspectDragInVerb 22
  206. #define kDETAspectDragInSummary 23
  207. #define kDETAspectRecordDragIn 24
  208. #define kDETAspectRecordCatDragIn 25
  209. #define kDETAspectAttrDragIn 26
  210. #define kDETAspectAttrDragOut 27
  211. #define kDETAspectViewMenu 28
  212. #define kDETAspectReverseSort 29
  213. #define kDETAspectInfoPageCustomWindow 30
  214.  
  215. /* Properties: */
  216.  
  217. #define kDETNoProperty -1
  218.  
  219. /* Each aspect has 250 attribute properties in this range: */
  220. #define kDETFirstLocalProperty 0
  221. #define kDETLastLocalProperty (kDETFirstLocalProperty+249)
  222.  
  223. /* Developers should use property numbers starting at this point: */
  224. #define kDETFirstDevProperty 40
  225.  
  226. /* The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  227.    given by kDETFirstConstantProperty+n): */
  228. #define kDETFirstConstantProperty 250
  229. #define kDETLastConstantProperty (kDETFirstConstantProperty+249)
  230.  
  231. /* To convert a number into a constant property, add this: */
  232. #define kDETConstantProperty kDETFirstConstantProperty
  233.  
  234. #define kDETZeroProperty (kDETConstantProperty+0)
  235. #define kDETOneProperty (kDETConstantProperty+1)
  236. #define kDETFalseProperty (kDETConstantProperty+0)
  237. #define kDETTrueProperty (kDETConstantProperty+1)
  238.  
  239. /* The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: */
  240. #define kDETPrName 3050
  241. #define kDETPrKind 3051
  242.  
  243. /* Access mask properties: */
  244. #define kDETDNodeAccessMask            25825    /* The DNode access mask */
  245. #define kDETRecordAccessMask        25826    /* The record access mask */
  246. #define kDETAttributeAccessMask        25827    /* The attribute access mask */
  247. #define kDETPrimaryMaskByBit        25828    /* A set of sixteen properties to access all bits of the primary mask */
  248.  
  249. /* See AOCE documentation for details definitions of each of these bits: */
  250. #define kDETPrimarySeeMask kDETPrimaryMaskByBit
  251. #define kDETPrimaryAddMask (kDETPrimaryMaskByBit+1)
  252. #define kDETPrimaryDeleteMask (kDETPrimaryMaskByBit+2)
  253. #define kDETPrimaryChangeMask (kDETPrimaryMaskByBit+3)
  254. #define kDETPrimaryRenameMask (kDETPrimaryMaskByBit+4)
  255. #define kDETPrimaryChangePrivsMask (kDETPrimaryMaskByBit+5)
  256. #define kDETPrimaryTopMaskBit (kDETPrimaryMaskByBit+15)
  257.  
  258. /* The following property is zero until we've completed the first catalog lookup; from then on it's 1 */
  259. #define kDETPastFirstLookup 26550
  260.  
  261. /* The following property is the page number; issuing a property command with this property will flip info-pages */
  262. #define kDETInfoPageNumber 27050
  263.  
  264. /* The value of the following properties contains the template number of the targeted aspect's template, and the
  265.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  266.    target selectors. */
  267. #define kDETAspectTemplateNumber 26551
  268. #define kDETInfoPageTemplateNumber 26552
  269.  
  270. /* Properties for property commands to deal with sublist items: */
  271. #define kDETOpenSelectedItems        26553    /* Open selected sublist items */
  272. #define kDETAddNewItem                26554    /* Add new sublist item */
  273. #define kDETRemoveSelectedItems        26555    /* Remove selected sublist items */
  274.  
  275. /* Property types are used to specify types of properties and conversions between types (zero and negative numbers
  276.    are reserved for Apple; developer code resources can use positive numbers): */
  277. #define kDETPrTypeNumber            -1    /* A number */
  278. #define kDETPrTypeString            -2    /* A string */
  279. #define kDETPrTypeBinary            -3    /* A binary block */
  280.  
  281. /* Rez-compatible tag definitions (•••these are the same as in OCE.h, but they're enums there and can't be rezed•••) */
  282. #ifdef REZ
  283. #define typeRString            'rstr'
  284. #define typePackedDSSpec    'dspc'
  285. #define typeBinary            'bnry'
  286. #endif
  287.  
  288. /* ************************************ Info-pages */
  289.  
  290. /* Info-pages include the following as well:
  291.  
  292.      Type    Offset                        Description
  293.      ----    ------                        -----------
  294.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  295.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  296.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  297.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ("Catalogs" if not present)
  298.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  299.  
  300. */
  301.  
  302. #define kDETInfoPageName 4
  303. #define kDETInfoPageMainViewAspect 5
  304. #define kDETInfoPageMenuName 6
  305. #define kDETInfoPageMenuEntries 7
  306.  
  307.  
  308. /* ************************************ Views */
  309.  
  310. /* Flags: */
  311.  
  312. #define kDETNoFlags 0
  313. #define kDETEnabled                        (1 << 0)    /* Main view (non-sublist) field enabled */
  314.  
  315. /* The following flags make sense for items in a sublist only */
  316. #define kDETHilightIfSelected            (1 << 0)    /* Hilight view when entry is selected */
  317.  
  318. /* The following flags make sense for text views only */
  319. #define kDETNumericOnly                    (1 << 3)    /* Only allow the user to enter digits */
  320. #define kDETMultiLine                    (1 << 4)    /* Allow multiple lines in view */
  321. #define kDETDynamicSize                    (1 << 9)    /* Don't draw box around text until user clicks in it, then auto-size it */
  322. #define kDETAllowNoColons                (1 << 10)    /* Don't allow the user to enter colons (convert ":"s to "-"s) */
  323.  
  324. /* The following flags are used for pop-up menus only */
  325. #define kDETPopupDynamicSize            (1 << 8)    /* Automatically resize pop-up based on contents */
  326.  
  327. /* The following flags are used for EditPicture views only */
  328. #define kDETScaleToView                    (1 << 8)    /* Scale picture to view bounds rather than cropping */
  329.  
  330. /*    Sizes for icons */
  331. #define kDETLargeIcon        0
  332. #define kDETSmallIcon        1
  333. #define kDETMiniIcon        2
  334.  
  335. /* Stolen from TextEdit.h */
  336. #define kDETLeft          0
  337. #define kDETCenter          1
  338. #define kDETRight         -1
  339. #define kDETForceLeft    -2
  340.  
  341. /* Flags for use within Box view type attributes - these are distinct from the flags above */
  342.  
  343. #define    kDETUnused                    0
  344. #define kDETBoxTakesContentClicks    (1 << 0)
  345. #define kDETBoxIsRounded            (1 << 1)
  346. #define kDETBoxIsGrayed                (1 << 2)
  347. #define kDETBoxIsInvisible            (1 << 3)
  348.  
  349. /* The common font info */
  350.  
  351. #define kDETApplicationFont                 1
  352. #define kDETApplicationFontSize          9
  353. #define kDETAppFontLineHeight            12
  354.  
  355. #define kDETSystemFont                     0
  356. #define kDETSystemFontSize                12
  357. #define kDETSystemFontLineHeight        16
  358.  
  359. #define kDETDefaultFont                     1
  360. #define kDETDefaultFontSize                 9
  361. #define kDETDefaultFontLineHeight        12
  362.  
  363. /*    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): */
  364. #define kDETNormal                        0
  365. #define kDETBold                        1
  366. #define kDETItalic                        2
  367. #define kDETUnderline                    4
  368. #define kDETOutline                        8
  369. #define kDETShadow                     0x10
  370. #define kDETCondense                 0x20
  371. #define kDETExtend                     0x40
  372.  
  373. #define kDETIconStyle                   -3    /* Normal text style for regular sublist entries, italic text style for aliases */
  374.  
  375. /* View menu: */
  376.  
  377. #define    kDETChangeViewCommand        'view'    /* Change the view; used especially in StaticCommandTextFromView sublist headers */
  378.  
  379. /* Info-page window sizes: */
  380.  
  381. /* Default record info-pages: */
  382. #define kDETRecordInfoWindHeight        228
  383. #define kDETRecordInfoWindWidth            400
  384.  
  385. /* Default attribute info-pages: */
  386. #define kDETAttributeInfoWindHeight        250
  387. #define kDETAttributeInfoWindWidth        230
  388.  
  389. /* Page identifying icon (for default info-page layout): */
  390. #define kDETSubpageIconTop        8
  391. #define kDETSubpageIconLeft        8
  392. #define kDETSubpageIconBottom    (kDETSubpageIconTop+32)
  393. #define kDETSubpageIconRight    (kDETSubpageIconLeft+32)
  394. #define kDETSubpageIconRect        {kDETSubpageIconTop, kDETSubpageIconLeft, kDETSubpageIconBottom, kDETSubpageIconRight}
  395.  
  396. /* The following rectangle can be used in a 'deti' with no sublist: */
  397. #define kDETNoSublistRect {0, 0, 0, 0}
  398.  
  399. /* ************************************ Killers */
  400.  
  401. /* Killers include the following as well:
  402.  
  403.      Type    Offset                        Description
  404.      ----    ------                        -----------
  405.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  406.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  407.  
  408. */
  409.  
  410. #define kDETKillerName 1
  411.  
  412. /* ************************************ Forwarders */
  413.  
  414. /* Forwarders include the following as well:
  415.  
  416.      Type    Offset                        Description
  417.      ----    ------                        -----------
  418.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  419.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  420.  
  421. */
  422.  
  423. #define kDETForwarderTemplateNames 4
  424.  
  425. /***********************************************************************************/
  426. /********************************* Categories: *************************************/
  427. /***********************************************************************************/
  428.  
  429. /* Internal category names: */
  430.  
  431. #define kDETCategoryAllItems "aoce All Items"
  432. #define kDETCategoryAddressItems "aoce Address Items"
  433. #define kDETCategoryMisc "aoce Miscellaneous"
  434.  
  435. /***********************************************************************************/
  436. /********************************* Code Resources: *********************************/
  437. /***********************************************************************************/
  438.  
  439. #ifndef REZ
  440. /* Target specification: */
  441. enum DETTargetSelector {
  442.     kDETSelf = 0,                    /* The "current" item */
  443.     kDETSelfOtherAspect,            /* Another aspect of the current item */
  444.     kDETParent,                        /* The parent (i.e., the aspect we're in the sublist of, if any) of the current item */
  445.     kDETSublistItem,                /* The itemNumberth item in the sublist */
  446.     kDETSelectedSublistItem,        /* The itemNumberth selected item in the sublist */
  447.     kDETDSSpec,                        /* The item specified by the packed DSSpec */
  448.     kDETAspectTemplate,                /* A specific aspect template (number itemNumber) */
  449.     kDETInfoPageTemplate,            /* A specific info-page template (number itemNumber) */
  450.     kDETHighSelector = 0xF000        /* Force type to be short */
  451. };
  452.  
  453. typedef long DETTargetSelector;
  454.  
  455. #if defined(powerc) || defined (__powerc)
  456. #pragma options align=mac68k
  457. #endif
  458. struct DETTargetSpecification {
  459.     DETTargetSelector selector;            /* Target selection method (see above) */
  460.     RStringPtr aspectName;                /* The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,
  461.                                            kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none;
  462.                                            always filled in for calls if there is an aspect, even if it's the main aspect */
  463.     long itemNumber;                    /* Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);
  464.                                            1-based indexing */
  465.     PackedDSSpecPtr dsSpec;                /* DSSpec (kDETDSSpec only) */
  466. };
  467. #if defined(powerc) || defined(__powerc)
  468. #pragma options align=reset
  469. #endif
  470.  
  471. typedef struct DETTargetSpecification DETTargetSpecification;
  472.  
  473. /* Code resource calls and call-backs both return an OSType:
  474.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  475.         noErr                    = function completed successfully
  476.         any error                = function failed, and here's why
  477. */
  478.  
  479. #define kDETDidNotHandle 1
  480.  
  481. /* Call-back functions:
  482.  
  483.         reqFunction                            Action
  484.         -----------                            ------
  485.         kDETcmdBeep                            Call SysBeep; useful for testing that a code resource's calls/call-backs are working at all
  486.  
  487.         kDETcmdBusy                            Put up watch cursor and switch processes; user events elicit a beep
  488.  
  489.         kDETcmdChangeCallFors                Change call-fors mask
  490.  
  491.         kDETcmdGetCommandSelectionCount        Get the command selection count (for calls which have a command selection list)
  492.         kDETcmdGetCommandItemN                Get command selection item n (for calls which have a command selection list)
  493.  
  494.         kDETcmdOpenDSSpec                    PackedDSSpec open (can also be done via AppleEvents -- this is a short-cut)
  495.  
  496.         kDETcmdAboutToTalk                    About to talk to user: bring us to front, disable watch cursor, etc.
  497.  
  498.         kDETcmdUnloadTemplates                Flush templates
  499.  
  500.         kDETcmdTemplateCounts                Return number of aspect and info-page templates in system
  501.  
  502.         kDETcmdGetDSSpec                    Get the PackedDSSpec for this object
  503.  
  504.         kDETcmdSublistCount                    Return the count of the sublist items
  505.         kDETcmdSelectedSublistCount            Return the count of the selected sublist items
  506.  
  507.         kDETcmdRequestSync                    Request a sync-up of the aspect with the catalog
  508.  
  509.         kDETcmdBreakAttribute                Break an attribute -- apply all applicable patterns to an attribute to generate properties
  510.  
  511.         kDETcmdGetTemplateFSSpec            Get the FSSpec of the file containing the template
  512.  
  513.         kDETcmdGetOpenEdit                    Return the property of the view being edited (or kDETNoProperty if none)
  514.         kDETcmdCloseEdit                    Close the current edit
  515.  
  516.         kDETcmdGetPropertyType                Get a property type
  517.  
  518.         kDETcmdGetPropertyNumber            Get a property, number format
  519.         kDETcmdGetPropertyRString            Get a property, RString format
  520.         kDETcmdGetPropertyBinarySize        Get a property, binary, return size
  521.         kDETcmdGetPropertyBinary            Get a property, binary format
  522.  
  523.         kDETcmdGetPropertyChanged            Get a property changed flag
  524.         kDETcmdGetPropertyEditable            Get a property editable flag
  525.  
  526.         kDETcmdSetPropertyType                Set a property type
  527.  
  528.         kDETcmdSetPropertyNumber            Set a property, number format
  529.         kDETcmdSetPropertyRString            Set a property, RString format
  530.         kDETcmdSetPropertyBinary            Set a property, binary data & size
  531.  
  532.         kDETcmdSetPropertyChanged            Set a property changed flag
  533.         kDETcmdSetPropertyEditable            Set a property editable flag
  534.  
  535.         kDETcmdDirtyProperty                Dirty a property (notify other code resources of change)
  536.  
  537.         kDETcmdDoPropertyCommand            Issue a property command
  538.  
  539.         kDETcmdAddMenu                        Add to the end of a dynamic menu
  540.         kDETcmdRemoveMenu                    Remove a dynamic menu item
  541.         kDETcmdMenuItemRString                Get a dynamic menu item RString
  542.  
  543.         kDETcmdSaveProperty                    Force a save of a property -- apply all applicable patterns to write out the property
  544.  
  545.         kDETcmdGetCustomViewUserReference    Get custom view user reference (as given in .r file)
  546.         kDETcmdGetCustomViewBounds            Get custom view current bounds
  547.  
  548.         kDETcmdGetResource                    Get a resource from a template
  549. */
  550.  
  551. enum DETCallBackFunctions {
  552.     kDETcmdSimpleCallback        = 0,
  553.     kDETcmdBeep,
  554.     kDETcmdBusy,
  555.     kDETcmdChangeCallFors,
  556.     kDETcmdGetCommandSelectionCount,
  557.     kDETcmdGetCommandItemN,
  558.     kDETcmdOpenDSSpec,
  559.     kDETcmdAboutToTalk,
  560.     kDETcmdUnloadTemplates,
  561.     kDETcmdTemplateCounts,
  562.     kDETcmdTargetedCallback        = 1000,
  563.     kDETcmdGetDSSpec,
  564.     kDETcmdSublistCount,
  565.     kDETcmdSelectedSublistCount,
  566.     kDETcmdRequestSync,
  567.     kDETcmdBreakAttribute,
  568.     kDETcmdGetTemplateFSSpec,
  569.     kDETcmdGetOpenEdit,
  570.     kDETcmdCloseEdit,
  571.     kDETcmdPropertyCallback        = 2000,
  572.     kDETcmdGetPropertyType,
  573.     kDETcmdGetPropertyNumber,
  574.     kDETcmdGetPropertyRString,
  575.     kDETcmdGetPropertyBinarySize,
  576.     kDETcmdGetPropertyBinary,
  577.     kDETcmdGetPropertyChanged,
  578.     kDETcmdGetPropertyEditable,
  579.     kDETcmdSetPropertyType,
  580.     kDETcmdSetPropertyNumber,
  581.     kDETcmdSetPropertyRString,
  582.     kDETcmdSetPropertyBinary,
  583.     kDETcmdSetPropertyChanged,
  584.     kDETcmdSetPropertyEditable,
  585.     kDETcmdDirtyProperty,
  586.     kDETcmdDoPropertyCommand,
  587.     kDETcmdAddMenu,
  588.     kDETcmdRemoveMenu,
  589.     kDETcmdMenuItemRString,
  590.     kDETcmdSaveProperty,
  591.     kDETcmdGetCustomViewUserReference,
  592.     kDETcmdGetCustomViewBounds,
  593.     kDETcmdGetResource,
  594.     kDETcmdHighCallback         = 0xF0000000        /* Force type to be long */
  595. };
  596.  
  597. typedef long DETCallBackFunctions;
  598.  
  599. #define DETCallBackBlockHeader     \
  600.     DETCallBackFunctions reqFunction;    /* Requested function */
  601.  
  602. #define DETCallBackBlockTargetedHeader  \
  603.     DETCallBackFunctions reqFunction;    /* Requested function */\
  604.     DETTargetSpecification target;        /* The target for the request */
  605.  
  606. #define DETCallBackBlockPropertyHeader  \
  607.     DETCallBackFunctions reqFunction;    /* Requested function */\
  608.     DETTargetSpecification target;        /* The target for the request */\
  609.     short property;                        /* The property to apply the request to */
  610.  
  611. #if defined(powerc) || defined (__powerc)
  612. #pragma options align=mac68k
  613. #endif
  614. struct DETProtoCallBackBlock {
  615.     DETCallBackFunctions        reqFunction;
  616.     DETTargetSpecification        target;
  617.     short                        property;
  618. };
  619. #if defined(powerc) || defined(__powerc)
  620. #pragma options align=reset
  621. #endif
  622.  
  623. typedef struct DETProtoCallBackBlock DETProtoCallBackBlock;
  624.  
  625. #if defined(powerc) || defined (__powerc)
  626. #pragma options align=mac68k
  627. #endif
  628. struct DETBeepBlock {
  629.     DETCallBackFunctions        reqFunction;
  630. };
  631. #if defined(powerc) || defined(__powerc)
  632. #pragma options align=reset
  633. #endif
  634.  
  635. typedef struct DETBeepBlock DETBeepBlock;
  636.  
  637. #if defined(powerc) || defined (__powerc)
  638. #pragma options align=mac68k
  639. #endif
  640. struct DETBusyBlock {
  641.     DETCallBackFunctions        reqFunction;
  642. };
  643. #if defined(powerc) || defined(__powerc)
  644. #pragma options align=reset
  645. #endif
  646.  
  647. typedef struct DETBusyBlock DETBusyBlock;
  648.  
  649. #if defined(powerc) || defined (__powerc)
  650. #pragma options align=mac68k
  651. #endif
  652. struct DETChangeCallForsBlock {
  653.     DETCallBackFunctions        reqFunction;
  654.     DETTargetSpecification        target;
  655.     long                         newCallFors;        /*  -> New call-for mask */
  656. };
  657. #if defined(powerc) || defined(__powerc)
  658. #pragma options align=reset
  659. #endif
  660.  
  661. typedef struct DETChangeCallForsBlock DETChangeCallForsBlock;
  662.  
  663. #if defined(powerc) || defined (__powerc)
  664. #pragma options align=mac68k
  665. #endif
  666. struct DETGetCommandSelectionCountBlock {
  667.     DETCallBackFunctions        reqFunction;
  668.     long                         count;            /* <-  The number of items in the command selection list */
  669. };
  670. #if defined(powerc) || defined(__powerc)
  671. #pragma options align=reset
  672. #endif
  673.  
  674. typedef struct DETGetCommandSelectionCountBlock DETGetCommandSelectionCountBlock;
  675.  
  676. enum DETItemType {
  677.     kDETHFSType = 0,                /* HFS item type */
  678.     kDETDSType,                        /* Catalog Service item type */
  679.     kDETMailType,                    /* Mail (letter) item type */
  680.     kDETMoverType,                    /* Sounds, fonts, etc., from inside a suitcase or system file */
  681.     kDETLastItemType = 0xF0000000    /* Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) */
  682. };
  683.  
  684. typedef long DETItemType;
  685.  
  686. #if defined(powerc) || defined (__powerc)
  687. #pragma options align=mac68k
  688. #endif
  689. /* FSSpec plus possibly interesting additional info */
  690. struct DETFSInfo {
  691.     OSType fileType;            /* File type */
  692.     OSType fileCreator;            /* File creator */
  693.     unsigned short fdFlags;        /* Finder flags */
  694.     FSSpec fsSpec;                /* FSSpec */
  695. };
  696. #if defined(powerc) || defined(__powerc)
  697. #pragma options align=reset
  698. #endif
  699.  
  700. typedef struct DETFSInfo DETFSInfo;
  701.  
  702. #if defined(powerc) || defined (__powerc)
  703. #pragma options align=mac68k
  704. #endif
  705. struct DETGetCommandItemNBlock {
  706.     DETCallBackFunctions        reqFunction;
  707.     long                         itemNumber;            /*  -> Item number to retrieve (1-based) */
  708.     DETItemType                 itemType;            /*  -> Type of item to be returned (if we can interpret it as such) */
  709.     union {
  710.         DETFSInfo                    **fsInfo;        /* <-  FSSpec & info for item (caller must DisposHandle() when done) */
  711.         struct {
  712.             PackedDSSpecPtr                *dsSpec;    /* <-  DSSpec for item (caller must DisposHandle() when done) */
  713.             short                        refNum;        /* <-  Refnum for returned address */
  714.             AuthIdentity                identity;    /* <-  Identity for returned address */
  715.         }                            ds;
  716.         PackedDSSpecPtr                *dsSpec;        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  717.         LetterSpec                    **ltrSpec;        /* <-  Letter spec for item (caller must DisposHandle() when done) */
  718.     }                            item;
  719. };
  720. #if defined(powerc) || defined(__powerc)
  721. #pragma options align=reset
  722. #endif
  723.  
  724. typedef struct DETGetCommandItemNBlock DETGetCommandItemNBlock;
  725.  
  726. #if defined(powerc) || defined (__powerc)
  727. #pragma options align=mac68k
  728. #endif
  729. struct DETGetDSSpecBlock {
  730.     DETCallBackFunctions        reqFunction;
  731.     DETTargetSpecification        target;
  732.     PackedDSSpecPtr                *dsSpec;            /* <-  Handle with result (caller must DisposHandle() when done) */
  733.     short                         refNum;                /* <-  Refnum for address if PD */
  734.     AuthIdentity                 identity;            /* <-  Identity for address */
  735.     Boolean                     isAlias;            /* <-  True if this entry is an alias */
  736.     Boolean                     isRecordRef;        /* <-  True if this entry is a record reference (reserved) */
  737. };
  738. #if defined(powerc) || defined(__powerc)
  739. #pragma options align=reset
  740. #endif
  741.  
  742. typedef struct DETGetDSSpecBlock DETGetDSSpecBlock;
  743.  
  744. #if defined(powerc) || defined (__powerc)
  745. #pragma options align=mac68k
  746. #endif
  747. struct DETGetTemplateFSSpecBlock {
  748.     DETCallBackFunctions        reqFunction;
  749.     DETTargetSpecification        target;
  750.     FSSpec                         fsSpec;                    /* <-  FSSpec of template file */
  751.     short                         baseID;                    /* <-  Base ID of this template */
  752.     long                         aspectTemplateNumber;    /* <-  The template number for this aspect template */
  753. };
  754. #if defined(powerc) || defined(__powerc)
  755. #pragma options align=reset
  756. #endif
  757.  
  758. typedef struct DETGetTemplateFSSpecBlock DETGetTemplateFSSpecBlock;
  759.  
  760. #if defined(powerc) || defined (__powerc)
  761. #pragma options align=mac68k
  762. #endif
  763. struct DETGetOpenEditBlock {
  764.     DETCallBackFunctions        reqFunction;
  765.     DETTargetSpecification        target;
  766.     short                         viewProperty;            /* <-  The property of the view being edited (or kNoProperty if none) */
  767. };
  768. #if defined(powerc) || defined(__powerc)
  769. #pragma options align=reset
  770. #endif
  771.  
  772. typedef struct DETGetOpenEditBlock DETGetOpenEditBlock;
  773.  
  774. #if defined(powerc) || defined (__powerc)
  775. #pragma options align=mac68k
  776. #endif
  777. struct DETCloseEditBlock {
  778.     DETCallBackFunctions        reqFunction;
  779.     DETTargetSpecification        target;
  780. };
  781. #if defined(powerc) || defined(__powerc)
  782. #pragma options align=reset
  783. #endif
  784.  
  785. typedef struct DETCloseEditBlock DETCloseEditBlock;
  786.  
  787. #if defined(powerc) || defined (__powerc)
  788. #pragma options align=mac68k
  789. #endif
  790. struct DETGetPropertyTypeBlock {
  791.     DETCallBackFunctions        reqFunction;
  792.     DETTargetSpecification        target;
  793.     short                        property;
  794.     short                         propertyType;    /* <-  The type of the property */
  795. };
  796. #if defined(powerc) || defined(__powerc)
  797. #pragma options align=reset
  798. #endif
  799.  
  800. typedef struct DETGetPropertyTypeBlock DETGetPropertyTypeBlock;
  801.  
  802. #if defined(powerc) || defined (__powerc)
  803. #pragma options align=mac68k
  804. #endif
  805. struct DETGetPropertyNumberBlock {
  806.     DETCallBackFunctions        reqFunction;
  807.     DETTargetSpecification        target;
  808.     short                        property;
  809.     unsigned                     long propertyValue;        /* <-  The value of the property */
  810. };
  811. #if defined(powerc) || defined(__powerc)
  812. #pragma options align=reset
  813. #endif
  814.  
  815. typedef struct DETGetPropertyNumberBlock DETGetPropertyNumberBlock;
  816.  
  817. #if defined(powerc) || defined (__powerc)
  818. #pragma options align=mac68k
  819. #endif
  820. struct DETGetPropertyRStringBlock {
  821.     DETCallBackFunctions        reqFunction;
  822.     DETTargetSpecification        target;
  823.     short                        property;
  824.     RStringHandle                 propertyValue;        /* <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) */
  825. };
  826. #if defined(powerc) || defined(__powerc)
  827. #pragma options align=reset
  828. #endif
  829.  
  830. typedef struct DETGetPropertyRStringBlock DETGetPropertyRStringBlock;
  831.  
  832. #if defined(powerc) || defined (__powerc)
  833. #pragma options align=mac68k
  834. #endif
  835. struct DETGetPropertyBinarySizeBlock {
  836.     DETCallBackFunctions        reqFunction;
  837.     DETTargetSpecification        target;
  838.     short                        property;
  839.     long                         propertyBinarySize;            /* <-  The size of the property as a binary block */
  840. };
  841. #if defined(powerc) || defined(__powerc)
  842. #pragma options align=reset
  843. #endif
  844.  
  845. typedef struct DETGetPropertyBinarySizeBlock DETGetPropertyBinarySizeBlock;
  846.  
  847. #if defined(powerc) || defined (__powerc)
  848. #pragma options align=mac68k
  849. #endif
  850. struct DETGetPropertyBinaryBlock {
  851.     DETCallBackFunctions        reqFunction;
  852.     DETTargetSpecification        target;
  853.     short                        property;
  854.     Handle                         propertyValue;        /* <-  Handle with the value of the property (caller must DisposHandle() when done) */
  855. };
  856. #if defined(powerc) || defined(__powerc)
  857. #pragma options align=reset
  858. #endif
  859.  
  860. typedef struct DETGetPropertyBinaryBlock DETGetPropertyBinaryBlock;
  861.  
  862. #if defined(powerc) || defined (__powerc)
  863. #pragma options align=mac68k
  864. #endif
  865. struct DETGetPropertyChangedBlock {
  866.     DETCallBackFunctions        reqFunction;
  867.     DETTargetSpecification        target;
  868.     short                        property;
  869.     Boolean                     propertyChanged;    /* <-  True if the property is marked as changed */
  870. };
  871. #if defined(powerc) || defined(__powerc)
  872. #pragma options align=reset
  873. #endif
  874.  
  875. typedef struct DETGetPropertyChangedBlock DETGetPropertyChangedBlock;
  876.  
  877. #if defined(powerc) || defined (__powerc)
  878. #pragma options align=mac68k
  879. #endif
  880. struct DETGetPropertyEditableBlock {
  881.     DETCallBackFunctions        reqFunction;
  882.     DETTargetSpecification        target;
  883.     short                        property;
  884.     Boolean                     propertyEditable;    /* <-  True if the property can be edited by the user (if false, view will appear disabled) */
  885. };
  886. #if defined(powerc) || defined(__powerc)
  887. #pragma options align=reset
  888. #endif
  889.  
  890. typedef struct DETGetPropertyEditableBlock DETGetPropertyEditableBlock;
  891.  
  892. #if defined(powerc) || defined (__powerc)
  893. #pragma options align=mac68k
  894. #endif
  895. struct DETSetPropertyTypeBlock {
  896.     DETCallBackFunctions        reqFunction;
  897.     DETTargetSpecification        target;
  898.     short                        property;
  899.     short                         newType;            /*  -> New type for property (just sets type, does not convert contents) */
  900. };
  901. #if defined(powerc) || defined(__powerc)
  902. #pragma options align=reset
  903. #endif
  904.  
  905. typedef struct DETSetPropertyTypeBlock DETSetPropertyTypeBlock;
  906.  
  907. #if defined(powerc) || defined (__powerc)
  908. #pragma options align=mac68k
  909. #endif
  910. struct DETSetPropertyNumberBlock {
  911.     DETCallBackFunctions        reqFunction;
  912.     DETTargetSpecification        target;
  913.     short                        property;
  914.     unsigned                     long newValue;        /*  -> New value to set property to (and set type to number) */
  915. };
  916. #if defined(powerc) || defined(__powerc)
  917. #pragma options align=reset
  918. #endif
  919.  
  920. typedef struct DETSetPropertyNumberBlock DETSetPropertyNumberBlock;
  921.  
  922. #if defined(powerc) || defined (__powerc)
  923. #pragma options align=mac68k
  924. #endif
  925. struct DETSetPropertyRStringBlock {
  926.     DETCallBackFunctions        reqFunction;
  927.     DETTargetSpecification        target;
  928.     short                        property;
  929.     RStringPtr                     newValue;        /*  -> New value to set property to (and set type to RString) */
  930. };
  931. #if defined(powerc) || defined(__powerc)
  932. #pragma options align=reset
  933. #endif
  934.  
  935. typedef struct DETSetPropertyRStringBlock DETSetPropertyRStringBlock;
  936.  
  937. #if defined(powerc) || defined (__powerc)
  938. #pragma options align=mac68k
  939. #endif
  940. struct DETSetPropertyBinaryBlock {
  941.     DETCallBackFunctions        reqFunction;
  942.     DETTargetSpecification        target;
  943.     short                        property;
  944.     Ptr                         newValue;        /*  -> New value to set property to (and set type to binary) */
  945.     long                         newValueSize;    /*  -> Size of new value */
  946. };
  947. #if defined(powerc) || defined(__powerc)
  948. #pragma options align=reset
  949. #endif
  950.  
  951. typedef struct DETSetPropertyBinaryBlock DETSetPropertyBinaryBlock;
  952.  
  953. #if defined(powerc) || defined (__powerc)
  954. #pragma options align=mac68k
  955. #endif
  956. struct DETSetPropertyChangedBlock {
  957.     DETCallBackFunctions        reqFunction;
  958.     DETTargetSpecification        target;
  959.     short                        property;
  960.     Boolean                     propertyChanged;    /*  -> Value to set changed flag on property to */
  961. };
  962. #if defined(powerc) || defined(__powerc)
  963. #pragma options align=reset
  964. #endif
  965.  
  966. typedef struct DETSetPropertyChangedBlock DETSetPropertyChangedBlock;
  967.  
  968. #if defined(powerc) || defined (__powerc)
  969. #pragma options align=mac68k
  970. #endif
  971. struct DETSetPropertyEditableBlock {
  972.     DETCallBackFunctions        reqFunction;
  973.     DETTargetSpecification        target;
  974.     short                        property;
  975.     Boolean                     propertyEditable;        /*  -> Value to set editable flag on property to */
  976. };
  977. #if defined(powerc) || defined(__powerc)
  978. #pragma options align=reset
  979. #endif
  980.  
  981. typedef struct DETSetPropertyEditableBlock DETSetPropertyEditableBlock;
  982.  
  983. #if defined(powerc) || defined (__powerc)
  984. #pragma options align=mac68k
  985. #endif
  986. struct DETDirtyPropertyBlock {
  987.     DETCallBackFunctions        reqFunction;
  988.     DETTargetSpecification        target;
  989.     short                        property;
  990. };
  991. #if defined(powerc) || defined(__powerc)
  992. #pragma options align=reset
  993. #endif
  994.  
  995. typedef struct DETDirtyPropertyBlock DETDirtyPropertyBlock;
  996.  
  997. #if defined(powerc) || defined (__powerc)
  998. #pragma options align=mac68k
  999. #endif
  1000. struct DETDoPropertyCommandBlock {
  1001.     DETCallBackFunctions        reqFunction;
  1002.     DETTargetSpecification        target;
  1003.     short                        property;
  1004.     long                         parameter;                /* ->  Parameter of command */
  1005. };
  1006. #if defined(powerc) || defined(__powerc)
  1007. #pragma options align=reset
  1008. #endif
  1009.  
  1010. typedef struct DETDoPropertyCommandBlock DETDoPropertyCommandBlock;
  1011.  
  1012. #if defined(powerc) || defined (__powerc)
  1013. #pragma options align=mac68k
  1014. #endif
  1015. struct DETSublistCountBlock {
  1016.     DETCallBackFunctions        reqFunction;
  1017.     DETTargetSpecification        target;
  1018.     long                         count;            /* <-  The number of items in the current item's sublist */
  1019. };
  1020. #if defined(powerc) || defined(__powerc)
  1021. #pragma options align=reset
  1022. #endif
  1023.  
  1024. typedef struct DETSublistCountBlock DETSublistCountBlock;
  1025.  
  1026. #if defined(powerc) || defined (__powerc)
  1027. #pragma options align=mac68k
  1028. #endif
  1029. struct DETSelectedSublistCountBlock {
  1030.     DETCallBackFunctions        reqFunction;
  1031.     DETTargetSpecification        target;
  1032.     long                         count;            /* <-  The number of selected items in the current item's sublist */
  1033. };
  1034. #if defined(powerc) || defined(__powerc)
  1035. #pragma options align=reset
  1036. #endif
  1037.  
  1038. typedef struct DETSelectedSublistCountBlock DETSelectedSublistCountBlock;
  1039.  
  1040. #if defined(powerc) || defined (__powerc)
  1041. #pragma options align=mac68k
  1042. #endif
  1043. struct DETRequestSyncBlock {
  1044.     DETCallBackFunctions        reqFunction;
  1045.     DETTargetSpecification        target;
  1046. };
  1047. #if defined(powerc) || defined(__powerc)
  1048. #pragma options align=reset
  1049. #endif
  1050.  
  1051. typedef struct DETRequestSyncBlock DETRequestSyncBlock;
  1052.  
  1053. #if defined(powerc) || defined (__powerc)
  1054. #pragma options align=mac68k
  1055. #endif
  1056. struct DETAddMenuBlock {
  1057.     DETCallBackFunctions        reqFunction;
  1058.     DETTargetSpecification        target;
  1059.     short                        property;
  1060.     RString                        *name;            /*  -> Name of new menu item */
  1061.     long                         parameter;        /*  -> Parameter to return when this item is selected */
  1062.     long                        addAfter;        /*  -> Parameter of entry to add after, or -1 for add at end */
  1063. };
  1064. #if defined(powerc) || defined(__powerc)
  1065. #pragma options align=reset
  1066. #endif
  1067.  
  1068. typedef struct DETAddMenuBlock DETAddMenuBlock;
  1069.  
  1070. #if defined(powerc) || defined (__powerc)
  1071. #pragma options align=mac68k
  1072. #endif
  1073. struct DETRemoveMenuBlock {
  1074.     DETCallBackFunctions        reqFunction;
  1075.     DETTargetSpecification        target;
  1076.     short                        property;
  1077.     long                         itemToRemove;    /*  -> Parameter of menu item to remove */
  1078. };
  1079. #if defined(powerc) || defined(__powerc)
  1080. #pragma options align=reset
  1081. #endif
  1082.  
  1083. typedef struct DETRemoveMenuBlock DETRemoveMenuBlock;
  1084.  
  1085. #if defined(powerc) || defined (__powerc)
  1086. #pragma options align=mac68k
  1087. #endif
  1088. struct DETMenuItemRStringBlock {
  1089.     DETCallBackFunctions        reqFunction;
  1090.     DETTargetSpecification        target;
  1091.     short                        property;
  1092.     long                         itemParameter;        /*  -> Parameter of menu item to return string for */
  1093.     RStringHandle                 rString;            /* <-  Handle with the RString (caller must DisposHandle() when done) */
  1094. };
  1095. #if defined(powerc) || defined(__powerc)
  1096. #pragma options align=reset
  1097. #endif
  1098.  
  1099. typedef struct DETMenuItemRStringBlock DETMenuItemRStringBlock;
  1100.  
  1101. #if defined(powerc) || defined (__powerc)
  1102. #pragma options align=mac68k
  1103. #endif
  1104. struct DETOpenDSSpecBlock {
  1105.     DETCallBackFunctions        reqFunction;
  1106.     PackedDSSpecPtr                dsSpec;            /*  -> DSSpec of object to be opened */
  1107. };
  1108. #if defined(powerc) || defined(__powerc)
  1109. #pragma options align=reset
  1110. #endif
  1111.  
  1112. typedef struct DETOpenDSSpecBlock DETOpenDSSpecBlock;
  1113.  
  1114. #if defined(powerc) || defined (__powerc)
  1115. #pragma options align=mac68k
  1116. #endif
  1117. struct DETAboutToTalkBlock {
  1118.     DETCallBackFunctions        reqFunction;
  1119. };
  1120. #if defined(powerc) || defined(__powerc)
  1121. #pragma options align=reset
  1122. #endif
  1123.  
  1124. typedef struct DETAboutToTalkBlock DETAboutToTalkBlock;
  1125.  
  1126. #if defined(powerc) || defined (__powerc)
  1127. #pragma options align=mac68k
  1128. #endif
  1129. struct DETBreakAttributeBlock {
  1130.     DETCallBackFunctions        reqFunction;
  1131.     DETTargetSpecification        target;
  1132.     AttributePtr                 breakAttribute;        /*  -> Attribute to parse */
  1133.     Boolean                     isChangeable;        /*  -> True if the value can be changed by the user */
  1134. };
  1135. #if defined(powerc) || defined(__powerc)
  1136. #pragma options align=reset
  1137. #endif
  1138.  
  1139. typedef struct DETBreakAttributeBlock DETBreakAttributeBlock;
  1140.  
  1141. #if defined(powerc) || defined (__powerc)
  1142. #pragma options align=mac68k
  1143. #endif
  1144. struct DETSavePropertyBlock {
  1145.     DETCallBackFunctions        reqFunction;
  1146.     DETTargetSpecification        target;
  1147.     short                        property;
  1148. };
  1149. #if defined(powerc) || defined(__powerc)
  1150. #pragma options align=reset
  1151. #endif
  1152.  
  1153. typedef struct DETSavePropertyBlock DETSavePropertyBlock;
  1154.  
  1155. #if defined(powerc) || defined (__powerc)
  1156. #pragma options align=mac68k
  1157. #endif
  1158. struct DETGetCustomViewUserReferenceBlock {
  1159.     DETCallBackFunctions        reqFunction;
  1160.     DETTargetSpecification        target;
  1161.     short                        property;
  1162.     short                         userReference;        /* <-  User reference value, as specified in the .r file */
  1163. };
  1164. #if defined(powerc) || defined(__powerc)
  1165. #pragma options align=reset
  1166. #endif
  1167.  
  1168. typedef struct DETGetCustomViewUserReferenceBlock DETGetCustomViewUserReferenceBlock;
  1169.  
  1170. #if defined(powerc) || defined (__powerc)
  1171. #pragma options align=mac68k
  1172. #endif
  1173. struct DETGetCustomViewBoundsBlock {
  1174.     DETCallBackFunctions        reqFunction;
  1175.     DETTargetSpecification        target;
  1176.     short                        property;
  1177.     Rect                         bounds;                /* <-  Bounds of the view */
  1178. };
  1179. #if defined(powerc) || defined(__powerc)
  1180. #pragma options align=reset
  1181. #endif
  1182.  
  1183. typedef struct DETGetCustomViewBoundsBlock DETGetCustomViewBoundsBlock;
  1184.  
  1185. #if defined(powerc) || defined (__powerc)
  1186. #pragma options align=mac68k
  1187. #endif
  1188. struct DETGetResourceBlock {
  1189.     DETCallBackFunctions        reqFunction;
  1190.     DETTargetSpecification        target;
  1191.     short                        property;
  1192.     ResType                     resourceType;        /*  -> Resource type */
  1193.     Handle                         theResource;        /* <-  The resource handle (caller must dispose when done) */
  1194. };
  1195. #if defined(powerc) || defined(__powerc)
  1196. #pragma options align=reset
  1197. #endif
  1198.  
  1199. typedef struct DETGetResourceBlock DETGetResourceBlock;
  1200.  
  1201. #if defined(powerc) || defined (__powerc)
  1202. #pragma options align=mac68k
  1203. #endif
  1204. struct DETTemplateCounts {
  1205.     DETCallBackFunctions        reqFunction;
  1206.     long                         aspectTemplateCount;            /* <-  Number of aspect templates in the system */
  1207.     long                         infoPageTemplateCount;            /* <-  Number of info-page templates in the system */
  1208. };
  1209. #if defined(powerc) || defined(__powerc)
  1210. #pragma options align=reset
  1211. #endif
  1212.  
  1213. typedef struct DETTemplateCounts DETTemplateCounts;
  1214.  
  1215. #if defined(powerc) || defined (__powerc)
  1216. #pragma options align=mac68k
  1217. #endif
  1218. struct DETUnloadTemplatesBlock {
  1219.     DETCallBackFunctions        reqFunction;
  1220. };
  1221. #if defined(powerc) || defined(__powerc)
  1222. #pragma options align=reset
  1223. #endif
  1224.  
  1225. typedef struct DETUnloadTemplatesBlock DETUnloadTemplatesBlock;
  1226.  
  1227. #if defined(powerc) || defined (__powerc)
  1228. #pragma options align=mac68k
  1229. #endif
  1230. union DETCallBackBlock {
  1231.     DETProtoCallBackBlock        protoCallBack;
  1232.     DETBeepBlock                beep;
  1233.     DETBusyBlock                busy;
  1234.     DETChangeCallForsBlock        changeCallFors;
  1235.     DETGetCommandSelectionCountBlock getCommandSelectionCount;
  1236.     DETGetCommandItemNBlock        getCommandItemN;
  1237.     DETGetDSSpecBlock            getDSSpec;
  1238.     DETGetTemplateFSSpecBlock    getTemplateFSSpec;
  1239.     DETGetOpenEditBlock            getOpenEdit;
  1240.     DETCloseEditBlock            closeEdit;
  1241.     DETGetPropertyTypeBlock        getPropertyType;
  1242.     DETGetPropertyNumberBlock    getPropertyNumber;
  1243.     DETGetPropertyRStringBlock    getPropertyRString;
  1244.     DETGetPropertyBinarySizeBlock getPropertyBinarySize;
  1245.     DETGetPropertyBinaryBlock    getPropertyBinary;
  1246.     DETGetPropertyChangedBlock    getPropertyChanged;
  1247.     DETGetPropertyEditableBlock    getPropertyEditable;
  1248.     DETSetPropertyTypeBlock        setPropertyType;
  1249.     DETSetPropertyNumberBlock    setPropertyNumber;
  1250.     DETSetPropertyRStringBlock    setPropertyRString;
  1251.     DETSetPropertyBinaryBlock    setPropertyBinary;
  1252.     DETSetPropertyChangedBlock    setPropertyChanged;
  1253.     DETSetPropertyEditableBlock    setPropertyEditable;
  1254.     DETDirtyPropertyBlock        dirtyProperty;
  1255.     DETDoPropertyCommandBlock    doPropertyCommand;
  1256.     DETSublistCountBlock        sublistCount;
  1257.     DETSelectedSublistCountBlock selectedSublistCount;
  1258.     DETRequestSyncBlock            requestSync;
  1259.     DETAddMenuBlock                addMenu;
  1260.     DETRemoveMenuBlock            removeMenu;
  1261.     DETMenuItemRStringBlock        menuItemRString;
  1262.     DETOpenDSSpecBlock            openDSSpec;
  1263.     DETAboutToTalkBlock            aboutToTalk;
  1264.     DETBreakAttributeBlock        breakAttribute;
  1265.     DETSavePropertyBlock        saveProperty;
  1266.     DETGetCustomViewUserReferenceBlock getCustomViewUserReference;
  1267.     DETGetCustomViewBoundsBlock    getCustomViewBounds;
  1268.     DETGetResourceBlock            getResource;
  1269.     DETTemplateCounts            templateCounts;
  1270.     DETUnloadTemplatesBlock        unloadTemplates;
  1271. };
  1272. #if defined(powerc) || defined(__powerc)
  1273. #pragma options align=reset
  1274. #endif
  1275.  
  1276. typedef union DETCallBackBlock DETCallBackBlock;
  1277.  
  1278. typedef DETCallBackBlock *DETCallBackBlockPtr;
  1279.  
  1280. typedef union DETCallBlock DETCallBlock;
  1281.  
  1282. typedef DETCallBlock *DETCallBlockPtr;
  1283.  
  1284. typedef pascal OSErr (*DETCallBackProcPtr)(union DETCallBlock *callBlockPtr, DETCallBackBlockPtr callBackBlockPtr);
  1285.  
  1286. enum {
  1287.     uppDETCallBackProcInfo = kPascalStackBased
  1288.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  1289.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DETCallBlock*)))
  1290.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DETCallBackBlockPtr)))
  1291. };
  1292.  
  1293. #if USESROUTINEDESCRIPTORS
  1294. typedef UniversalProcPtr DETCallBackUPP;
  1295.  
  1296. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr)        \
  1297.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDETCallBackProcInfo, (callBlockPtr), (callBackBlockPtr))
  1298. #define NewDETCallBackProc(userRoutine)        \
  1299.         (DETCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallBackProcInfo, GetCurrentISA())
  1300. #else
  1301. typedef DETCallBackProcPtr DETCallBackUPP;
  1302.  
  1303. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr)        \
  1304.         (*(userRoutine))((callBlockPtr), (callBackBlockPtr))
  1305. #define NewDETCallBackProc(userRoutine)        \
  1306.         (DETCallBackUPP)(userRoutine)
  1307. #endif
  1308.  
  1309. typedef DETCallBackUPP DETCallBack;
  1310.  
  1311. /* Call functions:
  1312.  
  1313.         reqFunction                        Action
  1314.         -----------                        ------
  1315.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  1316.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  1317.  
  1318.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  1319.                                         the value that's about to be created; sent to the template that will be used for
  1320.                                         the main aspect of the new entry
  1321.  
  1322.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  1323.  
  1324.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  1325.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  1326.  
  1327.         kDETcmdIdle                        Called periodically during idle times
  1328.  
  1329.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  1330.  
  1331.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  1332.  
  1333.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  1334.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  1335.  
  1336.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  1337.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  1338.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  1339.                                         main aspect of the attribute that's about to be deleted
  1340.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  1341.  
  1342.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  1343.  
  1344.         kDETcmdDynamicResource            Return a dynamically created resource
  1345.  
  1346.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  1347.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  1348.  
  1349.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  1350.  
  1351.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  1352.  
  1353.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  1354.  
  1355.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  1356.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  1357.  
  1358.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  1359.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  1360.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  1361.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  1362.  
  1363.         kDETcmdCustomViewDraw            Custom view draw
  1364.         kDETcmdCustomViewMouseDown        Custom view mouse down
  1365.  
  1366.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  1367.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  1368.  
  1369.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  1370.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  1371. */
  1372.  
  1373. enum DETCallFunctions {
  1374.     kDETcmdSimpleCall            = 0,
  1375.     kDETcmdInit,
  1376.     kDETcmdExit,
  1377.     kDETcmdAttributeCreation,
  1378.     kDETcmdDynamicForwarders,
  1379.     kDETcmdTargetedCall            = 1000,
  1380.     kDETcmdInstanceInit,
  1381.     kDETcmdInstanceExit,
  1382.     kDETcmdIdle,
  1383.     kDETcmdViewListChanged,
  1384.     kDETcmdValidateSave,
  1385.     kDETcmdDropQuery,
  1386.     kDETcmdDropMeQuery,
  1387.     kDETcmdAttributeNew,
  1388.     kDETcmdAttributeChange,
  1389.     kDETcmdAttributeDelete,
  1390.     kDETcmdItemNew,
  1391.     kDETcmdOpenSelf,
  1392.     kDETcmdDynamicResource,
  1393.     kDETcmdShouldSync,
  1394.     kDETcmdDoSync,
  1395.     kDETcmdPropertyCall            = 2000,
  1396.     kDETcmdPropertyCommand,
  1397.     kDETcmdMaximumTextLength,
  1398.     kDETcmdPropertyDirtied,
  1399.     kDETcmdPatternIn,
  1400.     kDETcmdPatternOut,
  1401.     kDETcmdConvertToNumber,
  1402.     kDETcmdConvertToRString,
  1403.     kDETcmdConvertFromNumber,
  1404.     kDETcmdConvertFromRString,
  1405.     kDETcmdCustomViewDraw,
  1406.     kDETcmdCustomViewMouseDown,
  1407.     kDETcmdKeyPress,
  1408.     kDETcmdPaste,
  1409.     kDETcmdCustomMenuSelected,
  1410.     kDETcmdCustomMenuEnabled,
  1411.     kDETcmdHighCall             = 0xF0000000    /* Force the type to be long */
  1412. };
  1413.  
  1414. typedef long DETCallFunctions;
  1415.  
  1416. #define DETCallBlockHeader         \
  1417.     DETCallFunctions reqFunction;    /* Requested function */\
  1418.     DETCallBack callBack;            /* Pointer to call-back routine */\
  1419.     long callBackPrivate;            /* Private data for the call-back routine */\
  1420.     long templatePrivate;            /* Private storage for use by code resource (stays for life of code resource,\
  1421.                                         common to all invocations of code resource) */
  1422.  
  1423. #define DETCallBlockTargetedHeader \
  1424.     DETCallFunctions reqFunction;    /* Requested function */\
  1425.     DETCallBack callBack;            /* Pointer to call-back routine */\
  1426.     long callBackPrivate;            /* Private data for the call-back routine */\
  1427.     long templatePrivate;            /* Private storage for use by code resource (stays for life of code resource,\
  1428.                                         common to all invocations of code resource) */\
  1429.     long instancePrivate;            /* Private storage for use by code resource (separate for each item using the\
  1430.                                         code resource) */\
  1431.     DETTargetSpecification target;    /* The target (originator) of the call, for targeted and property calls */\
  1432.     Boolean targetIsMainAspect;        /* True if the target is the main aspect (even though it has a non-nil name) */
  1433.  
  1434. #define DETCallBlockPropertyHeader \
  1435.     DETCallFunctions reqFunction;    /* Requested function */\
  1436.     DETCallBack callBack;            /* Pointer to call-back routine */\
  1437.     long callBackPrivate;            /* Private data for the call-back routine */\
  1438.     long templatePrivate;            /* Private storage for use by code resource (stays for life of code resource,\
  1439.                                         common to all invocations of code resource) */\
  1440.     long instancePrivate;            /* Private storage for use by code resource (separate for each item using the\
  1441.                                         code resource) */\
  1442.     DETTargetSpecification target;    /* The target (originator) of the call, for targeted and property calls */\
  1443.     Boolean targetIsMainAspect;        /* True if the target is the main aspect (even though it has a non-nil name) */\
  1444.     short property;                    /* The property number the call refers to */
  1445.  
  1446. #if defined(powerc) || defined (__powerc)
  1447. #pragma options align=mac68k
  1448. #endif
  1449. struct DETProtoCallBlock {
  1450.     DETCallFunctions            reqFunction;
  1451.     DETCallBack                    callBack;
  1452.     long                        callBackPrivate;
  1453.     long                        templatePrivate;
  1454.     long                        instancePrivate;
  1455.     DETTargetSpecification        target;
  1456.     Boolean                        targetIsMainAspect;
  1457.     short                        property;
  1458. };
  1459. #if defined(powerc) || defined(__powerc)
  1460. #pragma options align=reset
  1461. #endif
  1462.  
  1463. typedef struct DETProtoCallBlock DETProtoCallBlock;
  1464.  
  1465. #if defined(powerc) || defined (__powerc)
  1466. #pragma options align=mac68k
  1467. #endif
  1468. struct DETInitBlock {
  1469.     DETCallFunctions            reqFunction;
  1470.     DETCallBack                    callBack;
  1471.     long                        callBackPrivate;
  1472.     long                        templatePrivate;
  1473.     long                        newCallFors;                /* <-  New call-for mask */
  1474. };
  1475. #if defined(powerc) || defined(__powerc)
  1476. #pragma options align=reset
  1477. #endif
  1478.  
  1479. typedef struct DETInitBlock DETInitBlock;
  1480.  
  1481. #if defined(powerc) || defined (__powerc)
  1482. #pragma options align=mac68k
  1483. #endif
  1484. struct DETExitBlock {
  1485.     DETCallFunctions            reqFunction;
  1486.     DETCallBack                    callBack;
  1487.     long                        callBackPrivate;
  1488.     long                        templatePrivate;
  1489. };
  1490. #if defined(powerc) || defined(__powerc)
  1491. #pragma options align=reset
  1492. #endif
  1493.  
  1494. typedef struct DETExitBlock DETExitBlock;
  1495.  
  1496. #if defined(powerc) || defined (__powerc)
  1497. #pragma options align=mac68k
  1498. #endif
  1499. struct DETInstanceInitBlock {
  1500.     DETCallFunctions            reqFunction;
  1501.     DETCallBack                    callBack;
  1502.     long                        callBackPrivate;
  1503.     long                        templatePrivate;
  1504.     long                        instancePrivate;
  1505.     DETTargetSpecification        target;
  1506.     Boolean                        targetIsMainAspect;
  1507. };
  1508. #if defined(powerc) || defined(__powerc)
  1509. #pragma options align=reset
  1510. #endif
  1511.  
  1512. typedef struct DETInstanceInitBlock DETInstanceInitBlock;
  1513.  
  1514. #if defined(powerc) || defined (__powerc)
  1515. #pragma options align=mac68k
  1516. #endif
  1517. struct DETInstanceExitBlock {
  1518.     DETCallFunctions            reqFunction;
  1519.     DETCallBack                    callBack;
  1520.     long                        callBackPrivate;
  1521.     long                        templatePrivate;
  1522.     long                        instancePrivate;
  1523.     DETTargetSpecification        target;
  1524.     Boolean                        targetIsMainAspect;
  1525. };
  1526. #if defined(powerc) || defined(__powerc)
  1527. #pragma options align=reset
  1528. #endif
  1529.  
  1530. typedef struct DETInstanceExitBlock DETInstanceExitBlock;
  1531.  
  1532. #if defined(powerc) || defined (__powerc)
  1533. #pragma options align=mac68k
  1534. #endif
  1535. struct DETInstanceIdleBlock {
  1536.     DETCallFunctions            reqFunction;
  1537.     DETCallBack                    callBack;
  1538.     long                        callBackPrivate;
  1539.     long                        templatePrivate;
  1540.     long                        instancePrivate;
  1541.     DETTargetSpecification        target;
  1542.     Boolean                        targetIsMainAspect;
  1543. };
  1544. #if defined(powerc) || defined(__powerc)
  1545. #pragma options align=reset
  1546. #endif
  1547.  
  1548. typedef struct DETInstanceIdleBlock DETInstanceIdleBlock;
  1549.  
  1550. #if defined(powerc) || defined (__powerc)
  1551. #pragma options align=mac68k
  1552. #endif
  1553. struct DETPropertyCommandBlock {
  1554.     DETCallFunctions            reqFunction;
  1555.     DETCallBack                    callBack;
  1556.     long                        callBackPrivate;
  1557.     long                        templatePrivate;
  1558.     long                        instancePrivate;
  1559.     DETTargetSpecification        target;
  1560.     Boolean                        targetIsMainAspect;
  1561.     short                        property;
  1562.     long                         parameter;            /*  -> Parameter of command */
  1563. };
  1564. #if defined(powerc) || defined(__powerc)
  1565. #pragma options align=reset
  1566. #endif
  1567.  
  1568. typedef struct DETPropertyCommandBlock DETPropertyCommandBlock;
  1569.  
  1570. #if defined(powerc) || defined (__powerc)
  1571. #pragma options align=mac68k
  1572. #endif
  1573. struct DETMaximumTextLengthBlock {
  1574.     DETCallFunctions            reqFunction;
  1575.     DETCallBack                    callBack;
  1576.     long                        callBackPrivate;
  1577.     long                        templatePrivate;
  1578.     long                        instancePrivate;
  1579.     DETTargetSpecification        target;
  1580.     Boolean                        targetIsMainAspect;
  1581.     short                        property;
  1582.     long                         maxSize;    /* <-  Return the maximum number of characters the user can entry when property is edited in an EditText */
  1583. };
  1584. #if defined(powerc) || defined(__powerc)
  1585. #pragma options align=reset
  1586. #endif
  1587.  
  1588. typedef struct DETMaximumTextLengthBlock DETMaximumTextLengthBlock;
  1589.  
  1590. #if defined(powerc) || defined (__powerc)
  1591. #pragma options align=mac68k
  1592. #endif
  1593. struct DETViewListChangedBlock {
  1594.     DETCallFunctions            reqFunction;
  1595.     DETCallBack                    callBack;
  1596.     long                        callBackPrivate;
  1597.     long                        templatePrivate;
  1598.     long                        instancePrivate;
  1599.     DETTargetSpecification        target;
  1600.     Boolean                        targetIsMainAspect;
  1601. };
  1602. #if defined(powerc) || defined(__powerc)
  1603. #pragma options align=reset
  1604. #endif
  1605.  
  1606. typedef struct DETViewListChangedBlock DETViewListChangedBlock;
  1607.  
  1608. #if defined(powerc) || defined (__powerc)
  1609. #pragma options align=mac68k
  1610. #endif
  1611. struct DETPropertyDirtiedBlock {
  1612.     DETCallFunctions            reqFunction;
  1613.     DETCallBack                    callBack;
  1614.     long                        callBackPrivate;
  1615.     long                        templatePrivate;
  1616.     long                        instancePrivate;
  1617.     DETTargetSpecification        target;
  1618.     Boolean                        targetIsMainAspect;
  1619.     short                        property;
  1620. };
  1621. #if defined(powerc) || defined(__powerc)
  1622. #pragma options align=reset
  1623. #endif
  1624.  
  1625. typedef struct DETPropertyDirtiedBlock DETPropertyDirtiedBlock;
  1626.  
  1627. #if defined(powerc) || defined (__powerc)
  1628. #pragma options align=mac68k
  1629. #endif
  1630. struct DETValidateSaveBlock {
  1631.     DETCallFunctions            reqFunction;
  1632.     DETCallBack                    callBack;
  1633.     long                        callBackPrivate;
  1634.     long                        templatePrivate;
  1635.     long                        instancePrivate;
  1636.     DETTargetSpecification        target;
  1637.     Boolean                        targetIsMainAspect;
  1638.     RStringHandle                 errorString;        /* <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) */
  1639. };
  1640. #if defined(powerc) || defined(__powerc)
  1641. #pragma options align=reset
  1642. #endif
  1643.  
  1644. typedef struct DETValidateSaveBlock DETValidateSaveBlock;
  1645.  
  1646. /* Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): */
  1647. #define kDETDoNothing 'xxx0'
  1648. #define kDETMove 'move'
  1649. #define kDETDrag 'drag'
  1650. #define kDETAlias 'alis'
  1651.  
  1652. #if defined(powerc) || defined (__powerc)
  1653. #pragma options align=mac68k
  1654. #endif
  1655. struct DETDropQueryBlock {
  1656.     DETCallFunctions            reqFunction;
  1657.     DETCallBack                    callBack;
  1658.     long                        callBackPrivate;
  1659.     long                        templatePrivate;
  1660.     long                        instancePrivate;
  1661.     DETTargetSpecification        target;
  1662.     Boolean                        targetIsMainAspect;
  1663.     short                         modifiers;                /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1664.     long                        commandID;                /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1665.     AttributeType                 destinationType;        /* <-> Type to convert attribute to */
  1666.     Boolean                     copyToHFS;                /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1667. };
  1668. #if defined(powerc) || defined(__powerc)
  1669. #pragma options align=reset
  1670. #endif
  1671.  
  1672. typedef struct DETDropQueryBlock DETDropQueryBlock;
  1673.  
  1674. #if defined(powerc) || defined (__powerc)
  1675. #pragma options align=mac68k
  1676. #endif
  1677. struct DETDropMeQueryBlock {
  1678.     DETCallFunctions            reqFunction;
  1679.     DETCallBack                    callBack;
  1680.     long                        callBackPrivate;
  1681.     long                        templatePrivate;
  1682.     long                        instancePrivate;
  1683.     DETTargetSpecification        target;
  1684.     Boolean                        targetIsMainAspect;
  1685.     short                         modifiers;                /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1686.     long                         commandID;                /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1687.     AttributeType                 destinationType;        /* <-> Type to convert attribute to */
  1688.     Boolean                     copyToHFS;                /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1689. };
  1690. #if defined(powerc) || defined(__powerc)
  1691. #pragma options align=reset
  1692. #endif
  1693.  
  1694. typedef struct DETDropMeQueryBlock DETDropMeQueryBlock;
  1695.  
  1696. #if defined(powerc) || defined (__powerc)
  1697. #pragma options align=mac68k
  1698. #endif
  1699. struct DETAttributeCreationBlock {
  1700.     DETCallFunctions            reqFunction;
  1701.     DETCallBack                    callBack;
  1702.     long                        callBackPrivate;
  1703.     long                        templatePrivate;
  1704.     PackedDSSpecPtr             parent;                /*  -> The object within which the creation will occur */
  1705.     short                         refNum;                /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1706.     AuthIdentity                 identity;            /*  -> The identity we're browsing as in the parent object */
  1707.     AttributeType                 attrType;            /* <-> The type of the attribute being created */
  1708.     AttributeTag                 attrTag;            /* <-> The tag of the attribute being created */
  1709.     Handle                         value;                /* <-> The value to write (pre-allocated, resize as needed) */
  1710. };
  1711. #if defined(powerc) || defined(__powerc)
  1712. #pragma options align=reset
  1713. #endif
  1714.  
  1715. typedef struct DETAttributeCreationBlock DETAttributeCreationBlock;
  1716.  
  1717. #if defined(powerc) || defined (__powerc)
  1718. #pragma options align=mac68k
  1719. #endif
  1720. struct DETAttributeNewBlock {
  1721.     DETCallFunctions            reqFunction;
  1722.     DETCallBack                    callBack;
  1723.     long                        callBackPrivate;
  1724.     long                        templatePrivate;
  1725.     long                        instancePrivate;
  1726.     DETTargetSpecification        target;
  1727.     Boolean                        targetIsMainAspect;
  1728.     PackedDSSpecPtr             parent;                /*  -> The object within which the creation will occur */
  1729.     short                         refNum;                /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1730.     AuthIdentity                 identity;            /*  -> The identity we're browsing as in the parent object */
  1731.     AttributeType                 attrType;            /* <-> The type of the attribute being created */
  1732.     AttributeTag                 attrTag;            /* <-> The tag of the attribute being created */
  1733.     Handle                         value;                /* <-> The value to write (pre-allocated, resize as needed) */
  1734. };
  1735. #if defined(powerc) || defined(__powerc)
  1736. #pragma options align=reset
  1737. #endif
  1738.  
  1739. typedef struct DETAttributeNewBlock DETAttributeNewBlock;
  1740.  
  1741. #if defined(powerc) || defined (__powerc)
  1742. #pragma options align=mac68k
  1743. #endif
  1744. struct DETAttributeChangeBlock {
  1745.     DETCallFunctions            reqFunction;
  1746.     DETCallBack                    callBack;
  1747.     long                        callBackPrivate;
  1748.     long                        templatePrivate;
  1749.     long                        instancePrivate;
  1750.     DETTargetSpecification        target;
  1751.     Boolean                        targetIsMainAspect;
  1752.     PackedDSSpecPtr             parent;                /*  -> The object within which the creation will occur */
  1753.     short                         refNum;                /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1754.     AuthIdentity                 identity;            /*  -> The identity we're browsing as in the parent object */
  1755.     AttributeType                 attrType;            /* <-> The type of the attribute being changed */
  1756.     AttributeTag                 attrTag;            /* <-> The tag of the attribute being changed */
  1757.     AttributeCreationID         attrCID;            /* <-> The CID of the attribute being changed */
  1758.     Handle                         value;                /* <-> The value to write (pre-allocated, resize as needed) */
  1759. };
  1760. #if defined(powerc) || defined(__powerc)
  1761. #pragma options align=reset
  1762. #endif
  1763.  
  1764. typedef struct DETAttributeChangeBlock DETAttributeChangeBlock;
  1765.  
  1766. #if defined(powerc) || defined (__powerc)
  1767. #pragma options align=mac68k
  1768. #endif
  1769. struct DETAttributeDeleteBlock {
  1770.     DETCallFunctions            reqFunction;
  1771.     DETCallBack                    callBack;
  1772.     long                        callBackPrivate;
  1773.     long                        templatePrivate;
  1774.     long                        instancePrivate;
  1775.     DETTargetSpecification        target;
  1776.     Boolean                        targetIsMainAspect;
  1777.     PackedDSSpecPtr             dsSpec;                /*  -> The object which will be deleted */
  1778.     short                         refNum;                /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1779.     AuthIdentity                 identity;            /*  -> The identity we're browsing as */
  1780. };
  1781. #if defined(powerc) || defined(__powerc)
  1782. #pragma options align=reset
  1783. #endif
  1784.  
  1785. typedef struct DETAttributeDeleteBlock DETAttributeDeleteBlock;
  1786.  
  1787. #if defined(powerc) || defined (__powerc)
  1788. #pragma options align=mac68k
  1789. #endif
  1790. struct DETItemNewBlock {
  1791.     DETCallFunctions            reqFunction;
  1792.     DETCallBack                    callBack;
  1793.     long                        callBackPrivate;
  1794.     long                        templatePrivate;
  1795.     long                        instancePrivate;
  1796.     DETTargetSpecification        target;
  1797.     Boolean                        targetIsMainAspect;
  1798. };
  1799. #if defined(powerc) || defined(__powerc)
  1800. #pragma options align=reset
  1801. #endif
  1802.  
  1803. typedef struct DETItemNewBlock DETItemNewBlock;
  1804.  
  1805. #if defined(powerc) || defined (__powerc)
  1806. #pragma options align=mac68k
  1807. #endif
  1808. struct DETShouldSyncBlock {
  1809.     DETCallFunctions            reqFunction;
  1810.     DETCallBack                    callBack;
  1811.     long                        callBackPrivate;
  1812.     long                        templatePrivate;
  1813.     long                        instancePrivate;
  1814.     DETTargetSpecification        target;
  1815.     Boolean                        targetIsMainAspect;
  1816.     Boolean                     shouldSync;            /* <-  True if we should now sync with catalog */
  1817. };
  1818. #if defined(powerc) || defined(__powerc)
  1819. #pragma options align=reset
  1820. #endif
  1821.  
  1822. typedef struct DETShouldSyncBlock DETShouldSyncBlock;
  1823.  
  1824. #if defined(powerc) || defined (__powerc)
  1825. #pragma options align=mac68k
  1826. #endif
  1827. struct DETDoSyncBlock {
  1828.     DETCallFunctions            reqFunction;
  1829.     DETCallBack                    callBack;
  1830.     long                        callBackPrivate;
  1831.     long                        templatePrivate;
  1832.     long                        instancePrivate;
  1833.     DETTargetSpecification        target;
  1834.     Boolean                        targetIsMainAspect;
  1835. };
  1836. #if defined(powerc) || defined(__powerc)
  1837. #pragma options align=reset
  1838. #endif
  1839.  
  1840. typedef struct DETDoSyncBlock DETDoSyncBlock;
  1841.  
  1842. #if defined(powerc) || defined (__powerc)
  1843. #pragma options align=mac68k
  1844. #endif
  1845. struct DETPatternInBlock {
  1846.     DETCallFunctions            reqFunction;
  1847.     DETCallBack                    callBack;
  1848.     long                        callBackPrivate;
  1849.     long                        templatePrivate;
  1850.     long                        instancePrivate;
  1851.     DETTargetSpecification        target;
  1852.     Boolean                        targetIsMainAspect;
  1853.     short                        property;
  1854.     long                         elementType;        /*  -> Element type from pattern */
  1855.     long                         extra;                /*  -> Extra field from pattern */
  1856.     AttributePtr                 attribute;            /*  -> The complete attribute */
  1857.     long                         dataOffset;            /* <-> Offset to current (next) byte */
  1858.     short                         bitOffset;            /* <-> Bit offset (next bit is *fData >> fBitOffset++) */
  1859. };
  1860. #if defined(powerc) || defined(__powerc)
  1861. #pragma options align=reset
  1862. #endif
  1863.  
  1864. typedef struct DETPatternInBlock DETPatternInBlock;
  1865.  
  1866. #if defined(powerc) || defined (__powerc)
  1867. #pragma options align=mac68k
  1868. #endif
  1869. struct DETPatternOutBlock {
  1870.     DETCallFunctions            reqFunction;
  1871.     DETCallBack                    callBack;
  1872.     long                        callBackPrivate;
  1873.     long                        templatePrivate;
  1874.     long                        instancePrivate;
  1875.     DETTargetSpecification        target;
  1876.     Boolean                        targetIsMainAspect;
  1877.     short                        property;
  1878.     long                         elementType;        /*  -> Element type from pattern */
  1879.     long                         extra;                /*  -> Extra field from pattern */
  1880.     AttributePtr                 attribute;            /*  -> The attribute (minus the data portion) */
  1881.     Handle                         data;                /*  -> Data to be written (pre-allocated, resize and add at end) */
  1882.     long                         dataOffset;            /* <-> Offset to next byte to write */
  1883.     short                         bitOffset;            /* <-> Bit offset (if zero, handle will need to be resized to one more byte before write) */
  1884. };
  1885. #if defined(powerc) || defined(__powerc)
  1886. #pragma options align=reset
  1887. #endif
  1888.  
  1889. typedef struct DETPatternOutBlock DETPatternOutBlock;
  1890.  
  1891. #if defined(powerc) || defined (__powerc)
  1892. #pragma options align=mac68k
  1893. #endif
  1894. struct DETOpenSelfBlock {
  1895.     DETCallFunctions            reqFunction;
  1896.     DETCallBack                    callBack;
  1897.     long                        callBackPrivate;
  1898.     long                        templatePrivate;
  1899.     long                        instancePrivate;
  1900.     DETTargetSpecification        target;
  1901.     Boolean                        targetIsMainAspect;
  1902.     short                         modifiers;                /*  -> Modifiers at open time (option/control/command/shift keys) */
  1903. };
  1904. #if defined(powerc) || defined(__powerc)
  1905. #pragma options align=reset
  1906. #endif
  1907.  
  1908. typedef struct DETOpenSelfBlock DETOpenSelfBlock;
  1909.  
  1910. #if defined(powerc) || defined (__powerc)
  1911. #pragma options align=mac68k
  1912. #endif
  1913. struct DETConvertToNumberBlock {
  1914.     DETCallFunctions            reqFunction;
  1915.     DETCallBack                    callBack;
  1916.     long                        callBackPrivate;
  1917.     long                        templatePrivate;
  1918.     long                        instancePrivate;
  1919.     DETTargetSpecification        target;
  1920.     Boolean                        targetIsMainAspect;
  1921.     short                        property;
  1922.     long                         theValue;                    /* <-  The converted value to return */
  1923. };
  1924. #if defined(powerc) || defined(__powerc)
  1925. #pragma options align=reset
  1926. #endif
  1927.  
  1928. typedef struct DETConvertToNumberBlock DETConvertToNumberBlock;
  1929.  
  1930. #if defined(powerc) || defined (__powerc)
  1931. #pragma options align=mac68k
  1932. #endif
  1933. struct DETConvertToRStringBlock {
  1934.     DETCallFunctions            reqFunction;
  1935.     DETCallBack                    callBack;
  1936.     long                        callBackPrivate;
  1937.     long                        templatePrivate;
  1938.     long                        instancePrivate;
  1939.     DETTargetSpecification        target;
  1940.     Boolean                        targetIsMainAspect;
  1941.     short                        property;
  1942.     RStringHandle                 theValue;            /* <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) */
  1943. };
  1944. #if defined(powerc) || defined(__powerc)
  1945. #pragma options align=reset
  1946. #endif
  1947.  
  1948. typedef struct DETConvertToRStringBlock DETConvertToRStringBlock;
  1949.  
  1950. #if defined(powerc) || defined (__powerc)
  1951. #pragma options align=mac68k
  1952. #endif
  1953. struct DETConvertFromNumberBlock {
  1954.     DETCallFunctions            reqFunction;
  1955.     DETCallBack                    callBack;
  1956.     long                        callBackPrivate;
  1957.     long                        templatePrivate;
  1958.     long                        instancePrivate;
  1959.     DETTargetSpecification        target;
  1960.     Boolean                        targetIsMainAspect;
  1961.     short                        property;
  1962.     long                         theValue;            /*  -> The value to convert (result should be written direct to the property) */
  1963. };
  1964. #if defined(powerc) || defined(__powerc)
  1965. #pragma options align=reset
  1966. #endif
  1967.  
  1968. typedef struct DETConvertFromNumberBlock DETConvertFromNumberBlock;
  1969.  
  1970. #if defined(powerc) || defined (__powerc)
  1971. #pragma options align=mac68k
  1972. #endif
  1973. struct DETConvertFromRStringBlock {
  1974.     DETCallFunctions            reqFunction;
  1975.     DETCallBack                    callBack;
  1976.     long                        callBackPrivate;
  1977.     long                        templatePrivate;
  1978.     long                        instancePrivate;
  1979.     DETTargetSpecification        target;
  1980.     Boolean                        targetIsMainAspect;
  1981.     short                        property;
  1982.     RStringPtr                     theValue;            /*  -> The value to convert (result should be written direct to the property) */
  1983. };
  1984. #if defined(powerc) || defined(__powerc)
  1985. #pragma options align=reset
  1986. #endif
  1987.  
  1988. typedef struct DETConvertFromRStringBlock DETConvertFromRStringBlock;
  1989.  
  1990. #if defined(powerc) || defined (__powerc)
  1991. #pragma options align=mac68k
  1992. #endif
  1993. struct DETCustomViewDrawBlock {
  1994.     DETCallFunctions            reqFunction;
  1995.     DETCallBack                    callBack;
  1996.     long                        callBackPrivate;
  1997.     long                        templatePrivate;
  1998.     long                        instancePrivate;
  1999.     DETTargetSpecification        target;
  2000.     Boolean                        targetIsMainAspect;
  2001.     short                        property;
  2002. };
  2003. #if defined(powerc) || defined(__powerc)
  2004. #pragma options align=reset
  2005. #endif
  2006.  
  2007. typedef struct DETCustomViewDrawBlock DETCustomViewDrawBlock;
  2008.  
  2009. #if defined(powerc) || defined (__powerc)
  2010. #pragma options align=mac68k
  2011. #endif
  2012. struct DETCustomViewMouseDownBlock {
  2013.     DETCallFunctions            reqFunction;
  2014.     DETCallBack                    callBack;
  2015.     long                        callBackPrivate;
  2016.     long                        templatePrivate;
  2017.     long                        instancePrivate;
  2018.     DETTargetSpecification        target;
  2019.     Boolean                        targetIsMainAspect;
  2020.     short                        property;
  2021.     EventRecord                    *theEvent;    /*  -> The original event record of the mouse-down */
  2022. };
  2023. #if defined(powerc) || defined(__powerc)
  2024. #pragma options align=reset
  2025. #endif
  2026.  
  2027. typedef struct DETCustomViewMouseDownBlock DETCustomViewMouseDownBlock;
  2028.  
  2029. #if defined(powerc) || defined (__powerc)
  2030. #pragma options align=mac68k
  2031. #endif
  2032. struct DETKeyPressBlock {
  2033.     DETCallFunctions            reqFunction;
  2034.     DETCallBack                    callBack;
  2035.     long                        callBackPrivate;
  2036.     long                        templatePrivate;
  2037.     long                        instancePrivate;
  2038.     DETTargetSpecification        target;
  2039.     Boolean                        targetIsMainAspect;
  2040.     short                        property;
  2041.     EventRecord                    *theEvent;            /*  -> The original event record of the key-press */
  2042. };
  2043. #if defined(powerc) || defined(__powerc)
  2044. #pragma options align=reset
  2045. #endif
  2046.  
  2047. typedef struct DETKeyPressBlock DETKeyPressBlock;
  2048.  
  2049. #if defined(powerc) || defined (__powerc)
  2050. #pragma options align=mac68k
  2051. #endif
  2052. struct DETPasteBlock {
  2053.     DETCallFunctions            reqFunction;
  2054.     DETCallBack                    callBack;
  2055.     long                        callBackPrivate;
  2056.     long                        templatePrivate;
  2057.     long                        instancePrivate;
  2058.     DETTargetSpecification        target;
  2059.     Boolean                        targetIsMainAspect;
  2060.     short                        property;
  2061.     short                         modifiers;            /*  -> Modifiers at paste time (option/control/command/shift keys) */
  2062. };
  2063. #if defined(powerc) || defined(__powerc)
  2064. #pragma options align=reset
  2065. #endif
  2066.  
  2067. typedef struct DETPasteBlock DETPasteBlock;
  2068.  
  2069. #if defined(powerc) || defined (__powerc)
  2070. #pragma options align=mac68k
  2071. #endif
  2072. struct DETCustomMenuSelectedBlock {
  2073.     DETCallFunctions            reqFunction;
  2074.     DETCallBack                    callBack;
  2075.     long                        callBackPrivate;
  2076.     long                        templatePrivate;
  2077.     long                        instancePrivate;
  2078.     DETTargetSpecification        target;
  2079.     Boolean                        targetIsMainAspect;
  2080.     short                         menuTableParameter;        /*  -> The "property" field from the custom menu table */
  2081. };
  2082. #if defined(powerc) || defined(__powerc)
  2083. #pragma options align=reset
  2084. #endif
  2085.  
  2086. typedef struct DETCustomMenuSelectedBlock DETCustomMenuSelectedBlock;
  2087.  
  2088. #if defined(powerc) || defined (__powerc)
  2089. #pragma options align=mac68k
  2090. #endif
  2091. struct DETCustomMenuEnabledBlock {
  2092.     DETCallFunctions            reqFunction;
  2093.     DETCallBack                    callBack;
  2094.     long                        callBackPrivate;
  2095.     long                        templatePrivate;
  2096.     long                        instancePrivate;
  2097.     DETTargetSpecification        target;
  2098.     Boolean                        targetIsMainAspect;
  2099.     short                         menuTableParameter;        /*  -> The "property" field from the custom menu table */
  2100.     Boolean                     enable;                    /* <-  Whether to enable the menu item */
  2101. };
  2102. #if defined(powerc) || defined(__powerc)
  2103. #pragma options align=reset
  2104. #endif
  2105.  
  2106. typedef struct DETCustomMenuEnabledBlock DETCustomMenuEnabledBlock;
  2107.  
  2108. #if defined(powerc) || defined (__powerc)
  2109. #pragma options align=mac68k
  2110. #endif
  2111. struct DETForwarderListItem {
  2112.     struct DETForwarderListItem** next;        /* Pointer to next item, or nil */
  2113.     AttributeTag attributeValueTag;            /* Tag of new templates (0 for none) */
  2114.     PackedPathName rstrs;                    /* Record type (empty if none), attrbute type (empty if none),
  2115.                                                 list of template names to forward to */
  2116. };
  2117. #if defined(powerc) || defined(__powerc)
  2118. #pragma options align=reset
  2119. #endif
  2120.  
  2121. typedef struct DETForwarderListItem **DETForwarderListHandle;
  2122.  
  2123. #if defined(powerc) || defined (__powerc)
  2124. #pragma options align=mac68k
  2125. #endif
  2126. struct DETDynamicForwardersBlock {
  2127.     DETCallFunctions            reqFunction;
  2128.     DETCallBack                    callBack;
  2129.     long                        callBackPrivate;
  2130.     long                        templatePrivate;
  2131.     DETForwarderListHandle         forwarders;        /* <-  List of forwaders */
  2132. };
  2133. #if defined(powerc) || defined(__powerc)
  2134. #pragma options align=reset
  2135. #endif
  2136.  
  2137. typedef struct DETDynamicForwardersBlock DETDynamicForwardersBlock;
  2138.  
  2139. #if defined(powerc) || defined (__powerc)
  2140. #pragma options align=mac68k
  2141. #endif
  2142. struct DETDynamicResourceBlock {
  2143.     DETCallFunctions            reqFunction;
  2144.     DETCallBack                    callBack;
  2145.     long                        callBackPrivate;
  2146.     long                        templatePrivate;
  2147.     long                        instancePrivate;
  2148.     DETTargetSpecification        target;
  2149.     Boolean                        targetIsMainAspect;
  2150.     ResType                     resourceType;                /*  -> The resource type being requested */
  2151.     short                         propertyNumber;                /*  -> The property number of the resource being requested */
  2152.     short                         resourceID;                    /*  -> The resource ID (base ID + property number) of the resource */
  2153.     Handle                         theResource;                /* <-  The requested resource */
  2154. };
  2155. #if defined(powerc) || defined(__powerc)
  2156. #pragma options align=reset
  2157. #endif
  2158.  
  2159. typedef struct DETDynamicResourceBlock DETDynamicResourceBlock;
  2160.  
  2161. #if defined(powerc) || defined (__powerc)
  2162. #pragma options align=mac68k
  2163. #endif
  2164. union DETCallBlock {
  2165.     DETProtoCallBlock            protoCall;
  2166.     DETInitBlock                init;
  2167.     DETExitBlock                exit;
  2168.     DETInstanceInitBlock        instanceInit;
  2169.     DETInstanceExitBlock        instanceExit;
  2170.     DETInstanceIdleBlock        instanceIdle;
  2171.     DETPropertyCommandBlock        propertyCommand;
  2172.     DETMaximumTextLengthBlock    maximumTextLength;
  2173.     DETViewListChangedBlock        viewListChanged;
  2174.     DETPropertyDirtiedBlock        propertyDirtied;
  2175.     DETValidateSaveBlock        validateSave;
  2176.     DETDropQueryBlock            dropQuery;
  2177.     DETDropMeQueryBlock            dropMeQuery;
  2178.     DETAttributeCreationBlock    attributeCreationBlock;
  2179.     DETAttributeNewBlock        attributeNew;
  2180.     DETAttributeChangeBlock        attributeChange;
  2181.     DETAttributeDeleteBlock        attributeDelete;
  2182.     DETItemNewBlock                itemNew;
  2183.     DETPatternInBlock            patternIn;
  2184.     DETPatternOutBlock            patternOut;
  2185.     DETShouldSyncBlock            shouldSync;
  2186.     DETDoSyncBlock                doSync;
  2187.     DETOpenSelfBlock            openSelf;
  2188.     DETConvertToNumberBlock        convertToNumber;
  2189.     DETConvertToRStringBlock    convertToRString;
  2190.     DETConvertFromNumberBlock    convertFromNumber;
  2191.     DETConvertFromRStringBlock    convertFromRString;
  2192.     DETCustomViewDrawBlock        customViewDraw;
  2193.     DETCustomViewMouseDownBlock    customViewMouseDown;
  2194.     DETKeyPressBlock            keyPress;
  2195.     DETPasteBlock                paste;
  2196.     DETCustomMenuSelectedBlock    customMenuSelected;
  2197.     DETCustomMenuEnabledBlock    customMenuEnabled;
  2198.     DETDynamicForwardersBlock    dynamicForwarders;
  2199.     DETDynamicResourceBlock        dynamicResource;
  2200. };
  2201. #if defined(powerc) || defined(__powerc)
  2202. #pragma options align=reset
  2203. #endif
  2204.  
  2205. /* Call-for list: */
  2206.  
  2207. #define kDETCallForOther               1        /* Call for things not listed below (also auto-enabled by DE if any of the below are enabled) */
  2208. #define kDETCallForIdle                   2        /* kDETcmdIdle */
  2209. #define kDETCallForCommands               4        /* kDETcmdPropertyCommand, kDETcmdSelfOpen */
  2210. #define kDETCallForViewChanges           8        /* kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength */
  2211. #define kDETCallForDrops            0x10        /* kDETcmdDropQuery, kDETcmdDropMeQuery */
  2212. #define kDETCallForAttributes        0x20        /* kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete */
  2213. #define kDETCallForValidation        0x40        /* kDETcmdValidateSave */
  2214. #define kDETCallForKeyPresses        0x80        /* kDETcmdKeyPress and kDETcmdPaste */
  2215. #define kDETCallForResources       0x100        /* kDETcmdDynamicResource */
  2216. #define kDETCallForSyncing           0x200        /* kDETcmdShouldSync, kDETcmdDoSync */
  2217. #define kDETCallForEscalation      0x8000        /* All calls escalated from the next lower level */
  2218.  
  2219. #define kDETCallForNothing               0        /* None of the above */
  2220. #define kDETCallForEverything 0xFFFFFFFF        /* All of the above */
  2221.  
  2222.  
  2223. typedef DETCallUPP DETCall;
  2224.  
  2225.  
  2226. /* This following macro saves you from having to dig out the call-back pointer from the call block: */
  2227.  
  2228. #define CallBackDET(callBlockPtr, callBackBlockPtr) (CallDETCallBackProc(*(callBlockPtr)->protoCall.callBack,(callBlockPtr),(callBackBlockPtr)))
  2229.  
  2230.  
  2231. #endif
  2232.  
  2233. /************************************************************************************/
  2234. /********************************* SAM Definitions: *********************************/
  2235. /************************************************************************************/
  2236.  
  2237. /* SAM Developers should use property numbers starting at this point: */
  2238. #define kSAMFirstDevProperty                kDETFirstDevProperty + 10
  2239.  
  2240.  
  2241. /*
  2242.     SAM templates have additional resources/properties that are required
  2243.     for interaction with the AOCE Key Chain.
  2244.     
  2245.      Type    Offset                        Description
  2246.      ----    ------                        -----------
  2247.     'rstr'    kSAMAspectUserName            The user name
  2248.     'rstr'    kSAMAspectKind                The kind of SAM
  2249.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  2250.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  2251. */
  2252.  
  2253. #define kSAMAspectUserName                        kDETFirstDevProperty + 1
  2254. #define kSAMAspectKind                            kDETFirstDevProperty + 2
  2255. #define kSAMAspectCannotDelete                    kDETFirstDevProperty + 3
  2256. #define kSAMAspectSlotCreationInfo                kDETFirstDevProperty + 4
  2257.  
  2258.  
  2259. /**************************************************************************************/
  2260. /********************************* Admin Definitions: *********************************/
  2261. /**************************************************************************************/
  2262.  
  2263. #define kDETAdminVersion         -978
  2264.  
  2265.  
  2266. #endif
  2267.  
  2268.